package com.dangdi.show.shiro;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
//
//@ControllerAdvice
//public class MyExceptionResolver implements HandlerExceptionResolver {
//
//    public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
//        Map<String, Object> model = new ConcurrentHashMap<String, Object>();
//        model.put("ex", "出现错误错误！");
//        if (ex.getClass().getSimpleName().equals("UnauthorizedException")) {
//            model.put("ex", "您没有权限!");
//        }
//        return new ModelAndView("/403", model);
//    }
//}
